package com.smartstate.IOC.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartstate.IOC.entity.CarbonContribution;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ContributionMapper extends BaseMapper<CarbonContribution> {

    @Select("select sum(vegetation) from carbon_contribution;")
    Integer getVegetationTotal();

    @Select("select sum(parkPurificationDevice) from carbon_contribution;")
    Integer getParkPurificationDeviceTotal();

    @Select("select sum(tripartiteEngineering) from carbon_contribution;")
    Integer getTripartiteEngineeringTotal();

    @Select("select * from carbon_contribution")
    List<CarbonContribution> getTotal();

    @Select("select * from  carbon_contribution  where dateContribution =#{string}")
    CarbonContribution getMouthData(String string);

    @Select("select vegetation from carbon_contribution where dateContribution = #{s}")
    Integer getVegetationMouth(String s);

    @Select("select vegetation from carbon_contribution where dateContribution = #{s}")
    Integer getParkPurificationDeviceMouth(String s);

    @Select("select vegetation from carbon_contribution where dateContribution = #{s}")
    Integer getTripartiteEngineeringMouth(String s);
}
